package club.xyes.zkh.ecommerce.wechat.dto;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

/**
 * Create by 郭文梁 2019/5/6 0006 18:23
 * SaoBeiRefundResult
 * 扫呗退款申请返回结果
 *
 * @author 郭文梁
 * @data 2019/5/6 0006
 */
@Data
public class SaoBeiRefundResult {
    public static SaoBeiRefundResult fromJson(String json) {
        return JSON.parseObject(json, SaoBeiRefundResult.class);
    }

    @JSONField(name = "return_code")
    private String returnCode;
    @JSONField(name = "return_msg")
    private String returnMsg;
    @JSONField(name = "key_sign")
    private String keySign;
    @JSONField(name = "result_code")
    private String resultCode;
    @JSONField(name = "pay_type")
    private String payType;
    @JSONField(name = "merchant_name")
    private String merchantName;
    @JSONField(name = "merchant_no")
    private String merchantNo;
    @JSONField(name = "terminal_id")
    private String terminalId;
    @JSONField(name = "terminal_trace")
    private String terminalTrace;
    @JSONField(name = "terminal_time")
    private String terminalTime;
    @JSONField(name = "refund_fee")
    private String refundFee;
    @JSONField(name = "end_time")
    private String endTime;
    @JSONField(name = "out_trade_no")
    private String outTradeNo;
    @JSONField(name = "out_refund_no")
    private String outRefundNo;

    public boolean isSuccess() {
        return "01".equals(returnCode) && "01".equals(resultCode);
    }
}
